]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
bluetooth: Fix infinite loop
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 2 Apr 2020 10:42:41 +0000 (12:42 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 2 Apr 2020 12:08:00 +0000 (12:08 +0000)
Bailing out early of the loop means the iter is never increased,
resulting in an infinite loop.

Fixes 26c2cb9f6.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1165

js/ui/status/bluetooth.js

index ab167be02891052022fc58b23f4a4cfc91061502..04a6d5ae294eadfbad51727f680dee81ce2930a8 100644 (file)
@@ -84,15 +84,14 @@ class Indicator extends PanelMenu.SystemIndicator {
             const isTrusted = this._model.get_value(iter,
                 GnomeBluetooth.Column.TRUSTED);
 
-            if (!isPaired && !isTrusted)
-                continue;
-
-            deviceInfos.push({
-                connected: this._model.get_value(iter,
-                    GnomeBluetooth.Column.CONNECTED),
-                name: this._model.get_value(iter,
-                    GnomeBluetooth.Column.ALIAS),
-            });
+            if (isPaired || isTrusted) {
+                deviceInfos.push({
+                    connected: this._model.get_value(iter,
+                        GnomeBluetooth.Column.CONNECTED),
+                    name: this._model.get_value(iter,
+                        GnomeBluetooth.Column.ALIAS),
+                });
+            }
 
             ret = this._model.iter_next(iter);
         }